 <?php
echo $html->css ( 'style' );
echo $html->css ( 'tab' );
echo $javascript->link('jquery-1.4.2');
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
echo $html->css ( 'jquery-validate/css/screen' );
echo $javascript->link ( 'jquery-validate/jquery.validate');
echo $javascript->link ( 'jquery-validate/additional-methods');
echo $javascript->link ( 'jquery-validate/localization/messages_cn');
?>

<script type="text/javascript">
//添加验证
$(document).ready(function() {

//验证是否必填
function test(id)
{
	var srt = "font#" + id;
	var isValidate =  $(srt).text();
	var validate = $.trim(isValidate);
	if(validate == "*"){
		return true;
	} else {
		return false;
	}
}

	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
// validate signup form on keyup and submit
$("#f1").validate({

rules: {
"data[Companymanage][linkman]" : {
required: test("linkmand"),string:true,stringMinLength:0,stringMaxLength:50
},
"data[Companymanage][englishName]": {
required: test("englishName"),englishName:true,minlength:0,maxlength:50
},
"data[Companymanage][department]": {
required: test("department"),string:true,stringMinLength:0,stringMaxLength:100
},
"data[Companymanage][position]": {
required: test("position"),string:true,stringMinLength:0,stringMaxLength:100
},
"data[Companymanage][email]": {
required: test("email"),email:true
},
"data[Companymanage][tel]": {
required: test("tel"),phone:true
},
"data[Companymanage][mobilePhone]": {
required: test("mobilePhone"),mobile:true
},
"data[Companymanage][msnqq]": {
required: false,msnqq:true
},
"data[Companymanage][birthday]": {
required: false,dateISO:true
},
"data[Companymanage][fax]": {
required: false,fax:true
},
"data[Companymanage][memo]": {
required: false,stringMinLength:0,stringMaxLength:255
}
},
messages: {

},

focusInvalid:false,
onkeyup:false,
errorPlacement:function(error, element){
	error.appendTo(element.parent());
}
});

});
</script>

<script type="text/javascript">
	$(function(){
		$(".datepickerSpan :input").datepicker({
			inline: true
		});
		 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
		 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
	});
</script>
<!--<script type="text/javascript">-->
<!--	function mycheck() {-->
<!--		$("#f1").submit();	-->
<!--	}-->
<!--</script>-->
<!--<script type="text/javascript">-->
<!--$(document).ready(function(){-->
<!--	$("#ok").click(function(){-->
<!--		//var linkmanname = $("#CompanymanageLinkman").val();-->
<!--		//if(linkmanname == "")-->
<!--		//{-->
<!--		//	alert("联系人姓名不能为空");-->
<!--		//} else {-->
<!--			$("#f1").submit();-->
<!--		//}-->
<!--	});-->
<!--});-->
<!--</script>-->

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php ?>
									<?php echo $html->tag('span', __('Linkman Add',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<div class="tabflex">
<fieldset><legend><?php echo __('addlinkman')?></legend>
<?php echo $form->create('Companymanage',array('action'=>'addlinkman','type'=> 'post','id'=>"f1"));?>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
		<tr>
		<td width="5%"></td>
		<td width="10%">联系人姓名:
			<font color="red" id="linkmand">
				<?php if($fields['linkman'] == 1 && $fields['linkman'] !=null){echo "*";}?>
			</font>	
		</td>
		<td width="35%">
		<?php 
			echo $form->input('linkman',array('label'=>false));	
		?>
		</td>
		<td width="5%"></td>
		<td width="10%">英文简称:
			<font color="red" id="englishName">
				<?php if($fields['englishName'] == 1 && $fields['englishName'] !=null){echo "*";}?>
			</font>			
		</td>
		<td width="35%"> 
		<?php 
			echo $form->input('englishName',array('label'=>false));	
		?>
		</td>
		</tr>
		
		<tr>
		<td ></td>
		<td >MSN/QQ:</td>
		<td >
		<?php 
			echo $form->input('msnqq',array('label'=>false));
		?>
		</td>
		<td ></td>
		<td>性别:</td>
		<td>
		<?php 
			echo $form->input('sex',array('options'=>array("未知"=>"未知","男"=>"男","女"=>"女"),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));
		?>
		</td>
		</tr>
		
		<tr>
		<td></td>
		<td >生日:</td>
		<td>
		<span class="datepickerSpan">
		<?php 
			echo $form->input('birthday',array('label'=>false));
		?>
		</span>
		</td>
		<td ></td>
		<td>所属部门:
			<font color="red" id="department">
				<?php if($fields['department'] == 1 && $fields['department'] !=null){echo "*";}?>
			</font>			
		</td>
		<td>
		<?php 
			echo $form->input('department',array('label'=>false));
		?>
		</td>
		</tr>
		
		<tr>
		<td></td>
		<td >所在职位:
			<font color="red" id="position">
				<?php if($fields['position'] == 1 && $fields['position'] !=null){echo "*";}?>
			</font>			
		</td>
		<td>
		<?php 
			echo $form->input('position',array('label'=>false));	
		?>
		</td>
		<td></td>
		<td>联系电话:
			<font color="red" id="tel">
				<?php if($fields['tel'] == 1 && $fields['tel'] !=null){echo "*";}?>
			</font>			
		</td>
		<td>
		<?php 
			echo $form->input('tel',array('label'=>false));
		?>
		</td>
		</tr>
		
		<tr>
		<td></td>
		<td>联系手机:
			<font color="red" id="mobilePhone">
				<?php if($fields['mobilePhone'] == 1 && $fields['mobilePhone'] !=null){echo "*";}?>
			</font>			
		</td>
		<td >
		<?php 
			echo $form->input('mobilePhone',array('label'=>false));
		?>
		</td>
		<td ></td>
		<td >用人部门传真:</td>
		<td>
		<?php 
			echo $form->input('fax',array('label'=>false));
		?>
		</td>
		</tr>
		<tr>
		<td ></td>
		<td >邮箱地址:
			<font color="red" id="email">
				<?php if($fields['email'] == 1 && $fields['email'] !=null){echo "*";}?>
			</font>			
		</td>
		<td >
		<?php 
			echo $form->input('email',array('label'=>false));
		?>
		</td>
		<td ></td>
		<td >是否关键:</td>
		<td>
		<?php 
			echo $form->input('iskey',array('options'=>array("0"=>"否","1"=>"是"),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));
		?>
		</td>
		</tr>
		
		<tr>
		<td ></td>
		<td  style="vertical-align:top;">备注:</td>
		<td  colspan="4">
		<?php 
			echo $form->textarea('memo',array('label'=>false,'class' => 'TextArea1 txtOut'));
		?>
		</td>
		</tr>
</table>
</fieldset><!--
		<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
			<tr>
				<td width="50"></td>
				<td>
					<?php 
						echo "<br><input type='submit' id='ok' class='addsubmit' value='确定'/>"; ?>
				</td>
				<td>		
					<?php 	echo "<input type='reset' class='resetsubmit' id='reset' value='重置'/>";			
					?>
				</td>
			</tr>
		</table>
	--><table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php echo $form->button('确定',array('type'=>'submit','class'=>'addsubmit','id'=>'ok'));?>
		<td width="100"><?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit','id'=>'reset'));?>
		</td>
	</tr>
	</table>		
<?php echo $form->hidden('delStr',array('name'=>'id','id'=>'delStr'));?>
<?php echo $form->hidden('companymanage_id',array('default'=>$companymanageid));?>
<?php echo $form->end();?>
</div>